/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pruebas;

import java.util.Scanner;

/**
 *
 * @author ddpc
 */
public class masaltasmasbajas {
    Scanner teclado;
    float [] a;
    float media;
    public void insertar(){
        teclado = new Scanner(System.in);
        a = new float[5];
        for (int i = 0; i < a.length; i++) {
            System.out.println("inserta altura:");
            a[i]= teclado.nextFloat();
            media = media+a[i];
        }
        media = media/5;
    }
    public void saber(){
        int alto=0,bajo=0;
        for (int i = 0; i < a.length; i++) {
            if(a[i]>media){
                alto +=1;
            }
            else{
                bajo+=1;
            }
        }
        System.out.println("hay "+alto+" mas altos que la media y "+bajo+" mas bajos de la media "+media);
    }
    public static void main(String[] args) {
        masaltasmasbajas x = new masaltasmasbajas();
        x.insertar();
        x.saber();
        
    }
}
